Skip to content

🎨 Palette: Improve terminal UX accessibility with visible prompts and explicit cancel hints#183

Open
haseeb-heaven wants to merge 1 commit into
mainfrom
palette/tui-cancel-hints-3787583290221606918
Open

🎨 Palette: Improve terminal UX accessibility with visible prompts and explicit cancel hints#183
haseeb-heaven wants to merge 1 commit into
mainfrom
palette/tui-cancel-hints-3787583290221606918

Conversation

@haseeb-heaven

@haseeb-heaven haseeb-heaven commented Jul 3, 2026

Copy link
Copy Markdown
Owner

💡 What: Added explicit keyboard cancel hints (Ctrl-C to cancel), gracefully handled \x03 keystrokes to prevent keyboard traps, and surfaced available choices explicitly in headless inputs.
🎯 Why: To prevent terminal hangs from missing Esc ANSI sequences, give users explicit visual affordances for prompts, and provide a clear, reliable path to exit.
📸 Before/After: Before, non-interactive prompts didn't list options, and Esc caused hangs. After, choices are explicitly visible [code|chat|...] and Ctrl-C is properly handled.
♿ Accessibility: Improved terminal-equivalent accessibility by surfacing explicit keyboard shortcuts, avoiding keyboard traps, and clearly displaying available input choices.


PR created automatically by Jules for task 3787583290221606918 started by @haseeb-heaven

Summary by CodeRabbit

  • New Features

    • Improved terminal prompts to show available options more clearly in non-interactive environments.
    • Added visible shortcut guidance to selector footers, including a cancel hint.
  • Bug Fixes

    • Ctrl-C now cancels immediately and consistently in terminal input on both Windows and POSIX systems.
    • Clarified prompt behavior for raw terminal mode so cancel actions are shown correctly.

Added explicit keyboard cancel hints (`Ctrl-C to cancel`), gracefully handled
`\x03` keystrokes to prevent keyboard traps, and surfaced available choices
explicitly in headless inputs.
@google-labs-jules

Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

@coderabbitai

coderabbitai Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 4ccd92cb-4bb1-476e-90ef-b7efa5825898

📥 Commits

Reviewing files that changed from the base of the PR and between 2a47494 and 57c5c78.

📒 Files selected for processing (2)
  • .jules/palette.md
  • libs/terminal_ui.py

📝 Walkthrough

Walkthrough

Adds Ctrl-C detection to the terminal UI's key-reading logic on Windows and POSIX, raising KeyboardInterrupt when detected. Updates the selector footer to always show a cancel hint and modifies the non-TTY prompt to list available options. Adds a documentation note in the palette file.

Changes

Terminal UI Ctrl-C Handling

Layer / File(s) Summary
Ctrl-C detection in key reading
libs/terminal_ui.py
_read_key now checks for '\x03' on both Windows and POSIX input paths and raises KeyboardInterrupt immediately.
Selector footer and prompt text updates
libs/terminal_ui.py
_render_selector footer always appends "(Ctrl-C to cancel)"; non-TTY _select_option prompt now lists pipe-delimited options in the Prompt.ask text.
Palette documentation entry
.jules/palette.md
Adds a dated section documenting TUI shortcut conventions, headless rich prompt handling, and correct cancellation key usage.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant TerminalUI
  participant OS as "OS Input (msvcrt/stdin)"

  User->>TerminalUI: Trigger key read (_read_key)
  TerminalUI->>OS: Read single key
  OS-->>TerminalUI: Return key
  alt Key is Ctrl-C ('\x03')
    TerminalUI-->>User: Raise KeyboardInterrupt
  else Other key
    TerminalUI-->>User: Return key normally
  end
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main UX accessibility changes to terminal prompts and cancel hints.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch palette/tui-cancel-hints-3787583290221606918

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant